//
//  YBBlogDetailController.m
//  Cocoachina
//
//  Created by 尚往文化 on 17/9/14.
//  Copyright © 2017年 YBing. All rights reserved.
//

#import "YBBlogDetailController.h"

@interface YBBlogDetailController ()

@end

@implementation YBBlogDetailController

- (void)viewDidLoad {
    [super viewDidLoad];
}


- (void)hideHeader
{
    NSString *addfuncjs = @"function yb_add_hideHeader(){\
    var blog_content_right = document.getElementsByClassName(\"blog-content-right\")[0];\
    if(typeof(blog_content_right)!='undefined'){blog_content_right.style.display=\"none\";}\
    var footer = document.getElementsByClassName(\"footer\")[0];\
    if(typeof(footer)!='undefined'){footer.style.display=\"none\";}\
    var nav_header = document.getElementsByClassName(\"nav-header\")[0];\
    if(typeof(nav_header)!='undefined'){nav_header.style.display=\"none\";}\
    var breadtrip = document.getElementsByClassName(\"breadtrip\")[0];\
    if(typeof(breadtrip)!='undefined'){breadtrip.style.display=\"none\";}\
    var blog_container = document.getElementsByClassName(\"blog-container\")[0];\
    if(typeof(blog_container)!='undefined'){blog_container.style.cssText=\"width: 100%;\";}\
    var blog_content = document.getElementsByClassName(\"blog-content\")[0];\
    if(typeof(blog_content)!='undefined'){blog_content.style.cssText=\"width: 100%;\";}\
    var mainlist = document.getElementsByClassName(\"mainlist\")[0];\
    if(typeof(mainlist)!='undefined'){mainlist.style.cssText=\"width: 100%;\";}\
    var blogarea = document.getElementsByClassName(\"blogarea\")[0];\
    if(typeof(blogarea)!='undefined'){blogarea.style.cssText=\"width: 100%;padding: 0px;\";}\
    var add = document.getElementsByClassName(\"add\")[0];\
    if(typeof(add)!='undefined'){add.style.display=\"none\";}\
    var blog_share = document.getElementsByClassName(\"blog-share\")[0];\
    if(typeof(blog_share)!='undefined'){blog_share.style.display=\"none\";}\
    var r_bar = document.getElementsByClassName(\"r-bar\")[0];\
    if(typeof(r_bar)!='undefined'){r_bar.style.display=\"none\";}\
    var related = document.getElementsByClassName(\"related\")[0];\
    if(typeof(related)!='undefined'){related.style.display=\"none\";}\
    }";
    
    NSString *run_func = @"yb_add_hideHeader()";
    [self runJS:addfuncjs];
    [self runJS:run_func];
    
}

- (void)webViewDidFinishLoad:(UIWebView *)webView
{
    [super webViewDidFinishLoad:webView];
    [self hideHeader];
}

@end
